﻿using _RobotInspection.DTO;
using _RobotInspection.Entities;
using _RobotInspection.Models;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace _RobotInspection.Interfaces
{
    /// <summary>
    /// user相关接口类
    /// </summary>
    public interface IUserService
    {
        //用户服务，已实现Login和Register
        /// <summary>
        /// 登录功能
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="userPassword"></param>
        /// <returns></returns>
        Task<ApiResponse<UserDto>> LoginAsync(string userName, string userPassword);

        /// <summary>
        /// 注册功能
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        Task<ApiResponse<UserDto>> RegisterAsync(UserInsertDto queryDto);

        //用户增删改查
        /// <summary>
        /// 查询所有用户
        /// </summary>
        /// <returns></returns>
        Task<ApiResponse<List<UserDto>>> GetUsersAsync();
        /// <summary>
        /// 分页查询用户
        /// </summary>
        /// <returns></returns>
        Task<ApiResponse<UserPagedResultDto>> GetUsersPagedAsync(UserPagedQueryDto queryDto);
        /// <summary>
        /// 按Id查询用户
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ApiResponse<UserDto>> GetUserByIdAsync(long id);
        /// <summary>
        /// 按用户名查询用户
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        Task<ApiResponse<UserDto>> GetUserByUserNameAsync(string userName);
        /// <summary>
        /// 修改用户的用户名
        /// </summary>
        /// <param name="id"></param>
        /// <param name="userName></param>
        /// <returns></returns>
        Task<ApiResponse<UserDto>> UpdateUserNameAsync(long id, string userName);
        /// <summary>
        /// 修改用户的密码
        /// </summary>
        /// <param name="id"></param>
        /// <param name="userPassword"></param>
        /// <returns></returns>
        Task<ApiResponse<UserDto>> UpdateUserPasswordAsync(long id, string userPassword);
        /// <summary>
        /// 修改用户的权限
        /// </summary>
        /// <param name="id"></param>
        /// <param name="permission"></param>
        /// <returns></returns>
        Task<ApiResponse<UserDto>> UpdateUserPermissionAsync(long id, byte permission);
        /// <summary>
        /// 修改用户的状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        Task<ApiResponse<UserDto>> UpdateUserStatusAsync(long id, byte status);
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ApiResponse<UserDto?>> DeleteUserAsync(long id);

        /// <summary>
        /// 设备绑定用户
        /// </summary>
        /// <param name="UserId"></param>
        /// <param name="EquipmentId"></param>
        /// <returns></returns>
        Task<ActionResult<ApiResponse<bool>>> EquipmentBindingUser(int UserId, List<long> EquipmentId);
    }
}
